package thread;

public class ThreadDemo2 {
    public static void main(String[] args) {
        Thread t1 = new Mythread1();
        Thread t2 = new Mythread2();
        t1.start();
        t2.start();
    }
}

class Mythread1 extends Thread{
    public void run(){
        for(int i=0;i<1000;i++)
            System.out.println("线程1："+i);
    }
}
class Mythread2 extends Thread {
    public void run() {
        for (int i = 0; i < 1000; i++)
            System.out.println("线程2：" + i);
    }
}